package com.aerozhonghuan.logisticsmall.modules.order.base;

import com.aerozhonghuan.logisticsmall.R;

/**
 * 描述 订单状态枚举类 已废弃
 * @author zhangyonghui
 * 创建日期 2019-05-24
 */
public enum OrderStatus {
    /**
     * 待审核
     */
    WAITREVIEW(1002, "待审核", R.mipmap.ic_waitreview),
    /**
     * 待服务
     */
    WAITSERVICE(1003, "待服务", R.mipmap.ic_waitservice),
    /**
     * 待确认
     */
    WAITCONFIRM(1004, "待确认", R.mipmap.ic_waitconfirm),
    /**
     * 已完成
     */
    COMPLETED(1005, "已完成", R.mipmap.ic_completed),
    /**
     * 已取消
     */
    CANCELLED(1006, "已取消", R.mipmap.ic_cancelled);

    private int code;
    private String desc;
    private int iconId;

    OrderStatus(int code, String desc, int iconId){
        this.code = code;
        this.desc = desc;
        this.iconId = iconId;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getIconId() {
        return iconId;
    }

    public void setIconId(int iconId) {
        this.iconId = iconId;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getNameByCode(int code){
        for (OrderStatus status :
                OrderStatus.values()) {
            if (status.getCode() == code) {
                return status.getDesc();
            }
        }
        return "";
    }
}
